﻿using ProjBackEnd.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ProjBackEnd.Areas.Sys.Models
{
    /// <summary>
    /// 公司列表结果集
    /// </summary>
    public class ResultComSummary : BaseResultInfo
    {
        /// <summary>
        /// 公司列表
        /// </summary>
        public List<ComSummaryInfo> comsummarylist { get; set; }
    }
    /// <summary>
    /// 公司更新请求
    /// </summary>
    public class ReqComInfo : BaseUserRequest
    {
        /// <summary>
        /// 公司信息
        /// </summary>
        public ComSummaryInfo cominfo { get; set; }
    }
    /// <summary>
    /// 公司信息
    /// </summary>
    public class ComSummaryInfo:BaseOperableEntity
    {
        /// <summary>
        /// 公司代码
        /// </summary>
        [Required(ErrorMessage = "公司代码是必需的")]
        public string comcd { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>

        [RequiredConditional("optlb","IU",ErrorMessage = "公司名称是必需的")]
        public string comnm { get; set; }

        /// <summary>
        /// 集团代码
        /// </summary>
        [RequiredConditional("optlb", "IU", ErrorMessage = "集团代码是必需的")]
        public string gpcd { get; set; } = "";
        /// <summary>
        /// 集团名称
        /// </summary>
        public string groupnm { get; set; } = "";
    }

    /// <summary>
    /// 集团列表结果集
    /// </summary>
    public class ResultGroupInfo : BaseResultInfo
    {
        /// <summary>
        /// 集团列表
        /// </summary>
        public List<GroupInfo> gplist { get; set; } = new List<GroupInfo>();
    }
    /// <summary>
    /// 集团信息修改请求
    /// </summary>
    public class ReqGroupInfo : BaseUserRequest
    {
        public GroupInfo gpinfo { get; set; }
    }
    /// <summary>
    /// 集团信息
    /// </summary>
    public class GroupInfo : BaseOperableEntity
    {
        /// <summary>
        /// 集团代码
        /// </summary>
        [Required(ErrorMessage = "集团代码是必需的")]
        public string gpcd { get; set; }

        /// <summary>
        /// 集团名称
        /// </summary>
        [RequiredConditional("optlb", "IU", ErrorMessage = "集团名称是必需的")]
        public string gpnm { get; set; }
    }

    /// <summary>
    /// 部门列表结果集
    /// </summary>
    public class ResultDeptSummary : BaseResultInfo
    {
        /// <summary>
        /// 部门列表
        /// </summary>
        public List<DeptInfo> deptsummarylist { get; set; }
    }

    /// <summary>
    /// 部门操作请求
    /// </summary>
    public class ReqDept : BaseUserRequest
    {
        /// <summary>
        /// 部门信息
        /// </summary>
        [Required(ErrorMessage = "部门信息是必需的")]
        public DeptInfo deptinfo { get; set; }
    }

    /// <summary>
    /// 部门信息
    /// </summary>
    public class DeptInfo : BaseOperableEntity
    {
        /// <summary>
        /// 部门代码
        /// </summary>
        [RequiredConditional("optlb", "UD", ErrorMessage = "部门代码是必需的")]
        public string deptcd { get; set; }

        /// <summary>
        /// 所属公司代码
        /// </summary>
        [RequiredConditional("optlb", "I", ErrorMessage = "公司代码是必需的")]
        public string comcd { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        [RequiredConditional("optlb", "I", ErrorMessage = "部门名称是必需的")]
        public string deptnm { get; set; }

        /// <summary>
        /// 部门状态（备用字段，暂不开放）
        /// </summary>
        public string deptstat { get; set; }
    }


    /// <summary>
    /// 动态基础代码结果集
    /// </summary>
    public class ResultDynamicCode : BaseResultInfo
    {
        /// <summary>
        /// 基础代码列表
        /// </summary>
        public List<DynamicCodeInfo> classcodelist { get; set; }
    }

    /// <summary>
    /// 动态基础代码操作请求
    /// </summary>
    public class ReqDynamicCode : BaseUserRequest
    {
        /// <summary>
        /// 待操作的基础代码信息
        /// </summary>
        public DynamicCodeInfo classcodeinfo { get; set; }
    }

    /// <summary>
    /// 动态基础代码信息
    /// </summary>
    public class DynamicCodeInfo : BaseOperableEntity
    {
        /// <summary>
        /// 基础代码类别
        /// </summary>
        [Required(ErrorMessage = "代码分类不能为空")]
        [MaxLength(10, ErrorMessage = "代码分类长度超限")]
        public string attrcd { get; set; }

        /// <summary>
        /// 基础代码
        /// </summary>
        [Required(ErrorMessage = "代码不能为空")]
        [MaxLength(15, ErrorMessage = "代码长度超限")]
        public string cd { get; set; }

        /// <summary>
        /// 中文解释
        /// </summary>
        public string descchn { get; set; }

        /// <summary>
        /// 英文解释
        /// </summary>
        public string desceng { get; set; }

        /// <summary>
        /// 其他标识
        /// </summary>
        public string othcd { get; set; }

        /// <summary>
        /// 排序序号
        /// </summary>
        public int sortval { get; set; }
    }


}